import { get, post, put, del } from "@utils/http";

/**
 * @规则引擎
 */

// 新增/编辑规则
export const reqRuleEdit = (data) => post(`/ruleInfo/edit`, data);

// 规则分页
export const reqRulePage = (page, limit, params) =>
  post(`/ruleInfo/page/${page}/${limit}`, params);

// 批量删除
export const reqRuleRemoveByIds = (data) => post(`/ruleInfo/removeByIds`, data);

// 运行/停止规则
export const reqRuleState = (data) => put(`/ruleInfo/state`, data);

// 批量运行/停止规则
export const reqRuleStateBatch = (data) => put(`/ruleInfo/stateBatch`, data);

// 删除规则
export const reqRuleRemove = (id) => del(`/ruleInfo/remove/${id}`);

/**
 * @规则引擎日志
 */

// 规则日志分页
export const reqRuleRuleLog = (page, limit, params) =>
  post(`/ruleInfo/ruleLog/${page}/${limit}`, params);

// 删除规则日志
export const reqRuleRemoveLog = (id) => del(`/ruleInfo/removeLog/${id}`);

// 新增/编辑物模型
export const reqThingModel = (data) => post(`/thingModel/save`, data);

// 查看物模型
export const reqByProductKey = (productKey) =>
  get(`/thingModel/getByProductKey/${productKey}`);

// 删除物模型
export const reqThingModelRemove = (id) => del(`/thingModel/delete/${id}`);
